using System;

using NUnit.Framework;

using LocalBoard.Domain;
using LocalBoard.Persistence;

namespace LocalBoard.Controller
{
	/// <summary>
	/// Summary description for TestBoardSecurity.
	/// </summary>
	[TestFixture]
	public class TestBoardSecurity
	{
		IAccessorFactory _accessorFactory;
		private BoardSecurity _unitUnderTest11;
		private BoardSecurity _unitUnderTest12;
		private BoardSecurity _unitUnderTest13;
		private BoardSecurity _unitUnderTest14;
		private BoardSecurity _unitUnderTest21;
		private BoardSecurity _unitUnderTest22;
		private BoardSecurity _unitUnderTest23;
		private BoardSecurity _unitUnderTest24;
		private BoardSecurity _unitUnderTestForUser1AndBoard1;
		Profile _user11, _user12, _user3, _admin, _club1Manager, _board11Manager, _anonymous;
		private Profile _club2Manager, _board21Manager, _user21, _user22;
		protected IAttachmentAccessor _attachmentAccessor;
		protected IBoardAccessor _boardAccessor;
		protected IClubAccessor _clubAccessor;
		protected ICommentAccessor _commentAccessor;
		protected IPollItemAccessor _pollItemAccessor;
		protected IProfileAccessor _profileAccessor;
		protected IUserRoleAccessor _userRoleAccessor;
		protected IClubRoleAccessor _clubRoleAccessor;
		protected BoardController _board11Controller;
		protected BoardController _board12Controller;
		protected BoardController _board13Controller;
		protected BoardController _board14Controller;
		protected BoardController _board21Controller;
		protected BoardController _board22Controller;
		protected BoardController _board23Controller;
		protected BoardController _board24Controller;
		private ClubController _club1Controller;
		private ClubController _club2Controller;

		[SetUp]
		public void SetUp()
		{
			_accessorFactory = new MockAccessorFactory();
			_commentAccessor = _accessorFactory.GetCommentAccessor();

			AdminController adminController = new AdminController(_accessorFactory);
			int club1Id = adminController.CreateClub(new Club("testClub1", "Test club 1", 1, "","", null));
			_club1Controller = new ClubController(club1Id, _accessorFactory);
			int club2Id = adminController.CreateClub(new Club("testClub2", "Test club 2", 1, "","", null));
			_club2Controller = new ClubController(club2Id, _accessorFactory);

			int club1ManagerId = adminController.CreateUser(new Profile("club1Manager","club1 manager", "password","clubmanager@mail.com"));
			_club1Controller.AssignClubManager(club1ManagerId);
			_club1Manager = adminController.GetUser(club1ManagerId);
			int club2ManagerId = adminController.CreateUser(new Profile("club2Manager","club2 manager", "password","clubmanager@mail.com"));
			_club2Controller.AssignClubManager(club2ManagerId);
			_club2Manager = adminController.GetUser(club2ManagerId);

			int club1ReadRole = _club1Controller.CreateClubRole("read");
			int club1PostRole = _club1Controller.CreateClubRole("post");
			int role13Id = _club1Controller.CreateClubRole("role3");
			int club2ReadRole = _club2Controller.CreateClubRole("read");
			int club2PostRole = _club2Controller.CreateClubRole("post");

			int user11Id = adminController.CreateUser(new Profile("userId11","userName 1", "password1","email1@mail.com"));
			int user12Id = adminController.CreateUser(new Profile("userId12","userName 2", "password2","email2@mail.com"));
			int user21Id = adminController.CreateUser(new Profile("userId21","userName 1", "password1","email1@mail.com"));
			int user22Id = adminController.CreateUser(new Profile("userId22","userName 2", "password2","email2@mail.com"));
			_user3 = adminController.GetUser(adminController.CreateUser(new Profile("userId3","userName 3", "password3","email3@mail.com")));
			int adminId = adminController.CreateUser(new Profile("admin","admin", "password4","email4@mail.com"));
			_board11Manager = adminController.GetUser(adminController.CreateUser(new Profile("boardManager","board manager", "password","boardmanager@mail.com")));
			_board21Manager = adminController.GetUser(adminController.CreateUser(new Profile("board21Manager","board manager", "password","boardmanager@mail.com")));
			_anonymous = adminController.GetAnonymousUser();

			UserRole adminRole = adminController.GetUserRole(UserRole.ADMIN_ROLE_NAME);
			adminController.AssignUserRoleToUser(adminRole.Id, adminId);

			_club1Controller.AddUserClubProfile(null, user11Id);
			_club1Controller.AssignClubRoleToUser(club1ReadRole, user11Id);
			_club1Controller.AddUserClubProfile(null, user12Id);
			_club1Controller.AssignClubRoleToUser(club1PostRole, user12Id);
			_club2Controller.AddUserClubProfile(null, user21Id);
			_club2Controller.AssignClubRoleToUser(club2ReadRole, user21Id);
			_club2Controller.AddUserClubProfile(null, user22Id);
			_club2Controller.AssignClubRoleToUser(club2PostRole, user22Id);

			_user11 = adminController.GetUser(user11Id);//club1 memeber with read role
			_user12 = adminController.GetUser(user12Id);//club1 memeber with post role
			_user21 = adminController.GetUser(user21Id);//club2 memeber with read role
			_user22 = adminController.GetUser(user22Id);//club2 memeber with post role
			_admin = adminController.GetUser(adminId);

			int board11Id = _club1Controller.CreateBoard(new Board("Board 1",_board11Manager,	club1ReadRole,club1PostRole,_club1Controller.ClubId,BoardViewType.List));
			_board11Controller = new BoardController(board11Id, _club1Controller, 0, _accessorFactory);
			int board12Id = _club1Controller.CreateBoard(new Board("Board 2",null,	club1ReadRole,0,			_club1Controller.ClubId,BoardViewType.List));
			_board12Controller = new BoardController(board12Id, _club1Controller, 0, _accessorFactory);
			int board13Id = _club1Controller.CreateBoard(new Board("Board 3",null,	0,			club1PostRole,_club1Controller.ClubId,BoardViewType.List));
			_board13Controller = new BoardController(board13Id, _club1Controller, 0, _accessorFactory);
			int board14Id = _club1Controller.CreateBoard(new Board("Board 4",null,	0,			0,			_club1Controller.ClubId,BoardViewType.List));
			_board14Controller = new BoardController(board14Id, _club1Controller, 0, _accessorFactory);
			int board21Id = _club2Controller.CreateBoard(new Board("Board 5",_board21Manager,		club2ReadRole,club2PostRole,_club2Controller.ClubId,BoardViewType.List));
			_board21Controller = new BoardController(board21Id, _club2Controller, 0, _accessorFactory);
			int board22Id = _club2Controller.CreateBoard(new Board("Board 6",null,		club2ReadRole,0,			_club2Controller.ClubId,BoardViewType.List));
			_board22Controller = new BoardController(board22Id, _club2Controller, 0, _accessorFactory);
			int board23Id = _club2Controller.CreateBoard(new Board("Board 7",null,		0,			club2PostRole,_club2Controller.ClubId,BoardViewType.List));
			_board23Controller = new BoardController(board23Id, _club2Controller, 0, _accessorFactory);
			int board24Id = _club2Controller.CreateBoard(new Board("Board 8",null,		0,			0,			_club2Controller.ClubId,BoardViewType.List));
			_board24Controller = new BoardController(board24Id, _club2Controller, 0, _accessorFactory);

			_unitUnderTest11 = _board11Controller.GetBoardSecurity();
			_unitUnderTest12 = _board12Controller.GetBoardSecurity();
			_unitUnderTest13 = _board13Controller.GetBoardSecurity();
			_unitUnderTest14 = _board14Controller.GetBoardSecurity();
			_unitUnderTest21 = _board21Controller.GetBoardSecurity();
			_unitUnderTest22 = _board22Controller.GetBoardSecurity();
			_unitUnderTest23 = _board23Controller.GetBoardSecurity();
			_unitUnderTest24 = _board24Controller.GetBoardSecurity();
			_unitUnderTestForUser1AndBoard1 = _board11Controller.GetBoardSecurity(_user11);
		}
		[TearDown]
		public void TearDown()
		{
			MockAccessorFactory.ResetDataTable();
		}
		[Test]
		public void TestBoardSecurityForUser1AndBoard1()
		{
			Assert.IsTrue(_unitUnderTestForUser1AndBoard1.CanUserAccessBoard());
			Assert.IsFalse(_unitUnderTestForUser1AndBoard1.CanUserPostMessage());
			Message message1 = _board11Controller.GetMessage(_board11Controller.PostMessage("test", "test body", _user11, 0));
			Assert.IsTrue(_unitUnderTestForUser1AndBoard1.CanUserEditMessage(message1), "Author should be able to edit the message.");
			Assert.IsTrue(_unitUnderTestForUser1AndBoard1.CanUserDeleteMessage(message1), "Author should be able to delete the message.");
			Assert.IsFalse(_unitUnderTestForUser1AndBoard1.CanUserPostReply());
			Assert.IsFalse(_unitUnderTestForUser1AndBoard1.CanUserPostComment());
			MessageController message1Controller = new MessageController(message1, _accessorFactory);
			message1Controller.PostComment("test comment", _user11);
			Comment comment1 = _commentAccessor.GetCommentListByMessageId(message1.Id)[0] as Comment;
			Assert.IsTrue(_unitUnderTestForUser1AndBoard1.CanUserDeleteComment(comment1), "Author should be able to delete the message.");
		}
		[Test]
		public void TestCanUserAccessBoard()
		{
			Assert.IsTrue(_unitUnderTest11.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest11.CanUserAccessBoard(_club1Manager));
			Assert.IsTrue(_unitUnderTest11.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest11.CanUserAccessBoard(_user11));
			Assert.IsTrue(_unitUnderTest11.CanUserAccessBoard(_user12));
			Assert.IsFalse(_unitUnderTest11.CanUserAccessBoard(_club2Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserAccessBoard(_board21Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserAccessBoard(_user21));
			Assert.IsFalse(_unitUnderTest11.CanUserAccessBoard(_user22));
			Assert.IsFalse(_unitUnderTest11.CanUserAccessBoard(_user3));

			Assert.IsTrue(_unitUnderTest12.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest12.CanUserAccessBoard(_club1Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest12.CanUserAccessBoard(_user11));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_user12));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_club2Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_board21Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_user21));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_user22));
			Assert.IsFalse(_unitUnderTest12.CanUserAccessBoard(_user3));
			
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_club1Manager));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_user11));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_club2Manager));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_user21));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_user22));
			Assert.IsTrue(_unitUnderTest13.CanUserAccessBoard(_user3));

			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_club1Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_user11));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_club2Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_user21));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_user22));
			Assert.IsTrue(_unitUnderTest14.CanUserAccessBoard(_user3));

			Assert.IsTrue(_unitUnderTest21.CanUserAccessBoard(_admin));
			Assert.IsFalse(_unitUnderTest21.CanUserAccessBoard(_club1Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserAccessBoard(_board11Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserAccessBoard(_user11));
			Assert.IsFalse(_unitUnderTest21.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest21.CanUserAccessBoard(_club2Manager));
			Assert.IsTrue(_unitUnderTest21.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest21.CanUserAccessBoard(_user21));
			Assert.IsTrue(_unitUnderTest21.CanUserAccessBoard(_user22));
			Assert.IsFalse(_unitUnderTest21.CanUserAccessBoard(_user3));

			Assert.IsTrue(_unitUnderTest22.CanUserAccessBoard(_admin));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_club1Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_board11Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_user11));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest22.CanUserAccessBoard(_club2Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest22.CanUserAccessBoard(_user21));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_user22));
			Assert.IsFalse(_unitUnderTest22.CanUserAccessBoard(_user3));
			
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_club1Manager));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_user11));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_club2Manager));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_user21));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_user22));
			Assert.IsTrue(_unitUnderTest23.CanUserAccessBoard(_user3));

			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_admin));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_club1Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_board11Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_user11));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_user12));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_club2Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_board21Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_user21));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_user22));
			Assert.IsTrue(_unitUnderTest24.CanUserAccessBoard(_user3));
		}


		[Test]
		public void TestCanUserPostMessage()
		{
			Assert.IsTrue(_unitUnderTest11.CanUserPostMessage(_admin));
			Assert.IsTrue(_unitUnderTest11.CanUserPostMessage(_club1Manager));
			Assert.IsTrue(_unitUnderTest11.CanUserPostMessage(_board11Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_user11));
			Assert.IsTrue(_unitUnderTest11.CanUserPostMessage(_user12));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_club2Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_board21Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_user21));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest11.CanUserPostMessage(_user3));

			Assert.IsTrue(_unitUnderTest12.CanUserPostMessage(_admin));
			Assert.IsTrue(_unitUnderTest12.CanUserPostMessage(_club1Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_board11Manager));
			Assert.IsTrue(_unitUnderTest12.CanUserPostMessage(_user11));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_user12));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_club2Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_board21Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_user21));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest12.CanUserPostMessage(_user3));
			
			Assert.IsTrue(_unitUnderTest13.CanUserPostMessage(_admin));
			Assert.IsTrue(_unitUnderTest13.CanUserPostMessage(_club1Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_board11Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_user11));
			Assert.IsTrue(_unitUnderTest13.CanUserPostMessage(_user12));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_club2Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_board21Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_user21));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest13.CanUserPostMessage(_user3));

			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_admin));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_club1Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_board11Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_user11));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_user12));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_club2Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_board21Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_user21));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_user22));
			Assert.IsTrue(_unitUnderTest14.CanUserPostMessage(_user3));

			Assert.IsTrue(_unitUnderTest21.CanUserPostMessage(_admin));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_club1Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_board11Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_user11));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_user12));
			Assert.IsTrue(_unitUnderTest21.CanUserPostMessage(_club2Manager));
			Assert.IsTrue(_unitUnderTest21.CanUserPostMessage(_board21Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_user21));
			Assert.IsTrue(_unitUnderTest21.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest21.CanUserPostMessage(_user3));

			Assert.IsTrue(_unitUnderTest22.CanUserPostMessage(_admin));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_club1Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_board11Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_user11));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_user12));
			Assert.IsTrue(_unitUnderTest22.CanUserPostMessage(_club2Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_board21Manager));
			Assert.IsTrue(_unitUnderTest22.CanUserPostMessage(_user21));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest22.CanUserPostMessage(_user3));
			
			Assert.IsTrue(_unitUnderTest23.CanUserPostMessage(_admin));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_club1Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_board11Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_user11));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_user12));
			Assert.IsTrue(_unitUnderTest23.CanUserPostMessage(_club2Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_board21Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_user21));
			Assert.IsTrue(_unitUnderTest23.CanUserPostMessage(_user22));
			Assert.IsFalse(_unitUnderTest23.CanUserPostMessage(_user3));

			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_admin));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_club1Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_board11Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_user11));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_user12));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_club2Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_board21Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_user21));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_user22));
			Assert.IsTrue(_unitUnderTest24.CanUserPostMessage(_user3));
		}
		[Test]
		public void TestCanUserEditMessage()
		{
			Message message1 = _board11Controller.GetMessage(_board11Controller.PostMessage("test", "test body", _user11, 0));
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_admin, message1), "Administrator should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_board11Manager, message1), "_boardManager should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_club1Manager, message1), "_clubManager should not be able to edit the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserEditMessage(_user11, message1), "Author should be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_user12, message1), "_user2 should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_board21Manager, message1), "Other club's user should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_club2Manager, message1), "Other club's user should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_user21, message1), "Other club's user should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_user22, message1), "Other club's user should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_user3, message1), "_user3 should not be able to edit the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserEditMessage(_anonymous, message1), "_anonymous should not be able to edit the message.");
			Message message2 = _board12Controller.GetMessage(_board12Controller.PostMessage("test", "test body", _anonymous, 0));
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_admin, message2), "Administrator should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_board11Manager, message2), "_boardManager should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_club1Manager, message2), "_clubManager should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_user11, message2), "_user1 should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_user12, message2), "_user2 should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_board21Manager, message2), "Anyone should be able to edit the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_club2Manager, message2), "Anyone should be able to edit the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_user21, message2), "Anyone should be able to edit the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_user22, message2), "Anyone should be able to edit the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_user3, message2), "_user3 should be able to edit the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserEditMessage(_anonymous, message2), "_anonymous should be able to edit the anonymous message.");
		}
		[Test]
		public void TestCanUserDeleteMessage()
		{
			Message message1 = _board11Controller.GetMessage(_board11Controller.PostMessage("test", "test body", _user11, 0));
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteMessage(_admin, message1), "Administrator should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteMessage(_board11Manager, message1), "_boardManager should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteMessage(_club1Manager, message1), "_clubManager should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteMessage(_user11, message1), "Author should be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_user12, message1), "_user2 should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_board21Manager, message1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_club2Manager, message1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_user21, message1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_user22, message1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_user3, message1), "_user3 should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteMessage(_anonymous, message1), "_anonymous should not be able to delete the message.");
			Message message2 = _board12Controller.GetMessage(_board12Controller.PostMessage("test", "test body", _anonymous, 0));
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_admin, message2), "Administrator should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_board11Manager, message2), "_boardManager should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_club1Manager, message2), "_clubManager should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_user11, message2), "_user1 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_user12, message2), "_user2 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_board21Manager, message2), "Anyone should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_club2Manager, message2), "Anyone should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_user21, message2), "Anyone should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_user22, message2), "Anyone should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_user3, message2), "_user3 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteMessage(_anonymous, message2), "_anonymous should be able to delete the anonymous message.");
		}
		[Test]
		public void TestCanUserPostReply()
		{
			Assert.IsTrue(_unitUnderTest11.CanUserPostReply(_admin));
			Assert.IsTrue(_unitUnderTest11.CanUserPostReply(_club1Manager));
			Assert.IsTrue(_unitUnderTest11.CanUserPostReply(_board11Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_user11));
			Assert.IsTrue(_unitUnderTest11.CanUserPostReply(_user12));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_club2Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_board21Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_user21));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest11.CanUserPostReply(_user3));

			Assert.IsTrue(_unitUnderTest12.CanUserPostReply(_admin));
			Assert.IsTrue(_unitUnderTest12.CanUserPostReply(_club1Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_board11Manager));
			Assert.IsTrue(_unitUnderTest12.CanUserPostReply(_user11));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_user12));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_club2Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_board21Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_user21));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest12.CanUserPostReply(_user3));
			
			Assert.IsTrue(_unitUnderTest13.CanUserPostReply(_admin));
			Assert.IsTrue(_unitUnderTest13.CanUserPostReply(_club1Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_board11Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_user11));
			Assert.IsTrue(_unitUnderTest13.CanUserPostReply(_user12));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_club2Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_board21Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_user21));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest13.CanUserPostReply(_user3));

			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_admin));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_club1Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_board11Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_user11));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_user12));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_club2Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_board21Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_user21));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_user22));
			Assert.IsTrue(_unitUnderTest14.CanUserPostReply(_user3));

			Assert.IsTrue(_unitUnderTest21.CanUserPostReply(_admin));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_club1Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_board11Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_user11));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_user12));
			Assert.IsTrue(_unitUnderTest21.CanUserPostReply(_club2Manager));
			Assert.IsTrue(_unitUnderTest21.CanUserPostReply(_board21Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_user21));
			Assert.IsTrue(_unitUnderTest21.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest21.CanUserPostReply(_user3));

			Assert.IsTrue(_unitUnderTest22.CanUserPostReply(_admin));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_club1Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_board11Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_user11));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_user12));
			Assert.IsTrue(_unitUnderTest22.CanUserPostReply(_club2Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_board21Manager));
			Assert.IsTrue(_unitUnderTest22.CanUserPostReply(_user21));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest22.CanUserPostReply(_user3));
			
			Assert.IsTrue(_unitUnderTest23.CanUserPostReply(_admin));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_club1Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_board11Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_user11));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_user12));
			Assert.IsTrue(_unitUnderTest23.CanUserPostReply(_club2Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_board21Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_user21));
			Assert.IsTrue(_unitUnderTest23.CanUserPostReply(_user22));
			Assert.IsFalse(_unitUnderTest23.CanUserPostReply(_user3));

			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_admin));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_club1Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_board11Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_user11));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_user12));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_club2Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_board21Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_user21));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_user22));
			Assert.IsTrue(_unitUnderTest24.CanUserPostReply(_user3));
		}
		[Test]
		public void TestCanUserPostComment()
		{
			Assert.IsTrue(_unitUnderTest11.CanUserPostComment(_admin));
			Assert.IsTrue(_unitUnderTest11.CanUserPostComment(_club1Manager));
			Assert.IsTrue(_unitUnderTest11.CanUserPostComment(_board11Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_user11));
			Assert.IsTrue(_unitUnderTest11.CanUserPostComment(_user12));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_club2Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_board21Manager));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_user21));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest11.CanUserPostComment(_user3));

			Assert.IsTrue(_unitUnderTest12.CanUserPostComment(_admin));
			Assert.IsTrue(_unitUnderTest12.CanUserPostComment(_club1Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_board11Manager));
			Assert.IsTrue(_unitUnderTest12.CanUserPostComment(_user11));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_user12));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_club2Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_board21Manager));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_user21));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest12.CanUserPostComment(_user3));
			
			Assert.IsTrue(_unitUnderTest13.CanUserPostComment(_admin));
			Assert.IsTrue(_unitUnderTest13.CanUserPostComment(_club1Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_board11Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_user11));
			Assert.IsTrue(_unitUnderTest13.CanUserPostComment(_user12));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_club2Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_board21Manager));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_user21));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest13.CanUserPostComment(_user3));

			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_admin));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_club1Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_board11Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_user11));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_user12));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_club2Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_board21Manager));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_user21));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_user22));
			Assert.IsTrue(_unitUnderTest14.CanUserPostComment(_user3));

			Assert.IsTrue(_unitUnderTest21.CanUserPostComment(_admin));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_club1Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_board11Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_user11));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_user12));
			Assert.IsTrue(_unitUnderTest21.CanUserPostComment(_club2Manager));
			Assert.IsTrue(_unitUnderTest21.CanUserPostComment(_board21Manager));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_user21));
			Assert.IsTrue(_unitUnderTest21.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest21.CanUserPostComment(_user3));

			Assert.IsTrue(_unitUnderTest22.CanUserPostComment(_admin));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_club1Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_board11Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_user11));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_user12));
			Assert.IsTrue(_unitUnderTest22.CanUserPostComment(_club2Manager));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_board21Manager));
			Assert.IsTrue(_unitUnderTest22.CanUserPostComment(_user21));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest22.CanUserPostComment(_user3));
			
			Assert.IsTrue(_unitUnderTest23.CanUserPostComment(_admin));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_club1Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_board11Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_user11));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_user12));
			Assert.IsTrue(_unitUnderTest23.CanUserPostComment(_club2Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_board21Manager));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_user21));
			Assert.IsTrue(_unitUnderTest23.CanUserPostComment(_user22));
			Assert.IsFalse(_unitUnderTest23.CanUserPostComment(_user3));

			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_admin));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_club1Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_board11Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_user11));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_user12));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_club2Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_board21Manager));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_user21));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_user22));
			Assert.IsTrue(_unitUnderTest24.CanUserPostComment(_user3));
		}
		public void TestCanUserDeleteComment()
		{
			Message message1 = _board11Controller.GetMessage(_board11Controller.PostMessage("test", "test body", _user11, 0));
			MessageController message1Controller = new MessageController(message1, _accessorFactory);
			message1Controller.PostComment("test comment", _user11);
			Comment comment1 = _commentAccessor.GetCommentListByMessageId(message1.Id)[0] as Comment;
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteComment(_admin, comment1), "Administrator should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteComment(_board11Manager, comment1), "_boardManager should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteComment(_club1Manager, comment1), "_clubManager should be able to delete the message.");
			Assert.IsTrue(_unitUnderTest11.CanUserDeleteComment(_user11, comment1), "Author should be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_user12, comment1), "_user2 should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_board21Manager, comment1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_club2Manager, comment1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_user21, comment1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_user22, comment1), "Other club's user should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_user3, comment1), "_user3 should not be able to delete the message.");
			Assert.IsFalse(_unitUnderTest11.CanUserDeleteComment(_anonymous, comment1), "_anonymous should not be able to delete the message.");
			Message message2 = _board12Controller.GetMessage(_board12Controller.PostMessage("test", "test body", _anonymous, 0));
			MessageController message2Controller = new MessageController(message2, _accessorFactory);
			message2Controller.PostComment("test comment", _anonymous);
			Comment comment2 = _commentAccessor.GetCommentListByMessageId(message2.Id)[0] as Comment;
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_admin, comment2), "Administrator should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_board11Manager, comment2), "_boardManager should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_club1Manager, comment2), "_clubManager should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_user11, comment2), "_user1 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_user12, comment2), "_user2 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_board21Manager, comment2), "Anyone should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_club2Manager, comment2), "Anyone should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_user21, comment2), "Anyone should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_user22, comment2), "Anyone should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_user3, comment2), "_user3 should be able to delete the anonymous message.");
			Assert.IsTrue(_unitUnderTest12.CanUserDeleteComment(_anonymous, comment2), "_anonymous should be able to delete the anonymous message.");
		}

		[Test]
		public void testCanUserCastVote()
		{
			int messageId = _board11Controller.PostMessage("Test message", "Test Message", _anonymous, 0);
			Message message = _board11Controller.GetMessage(messageId);
			Assert.IsTrue(_unitUnderTest11.CanUserRateArticle(_user11, message));
			Assert.IsFalse(_unitUnderTest11.CanUserRateArticle(_anonymous, message));
			int messageId2 = _board11Controller.PostMessage("Test message2", "Test Message2", _user11, 0);
			Message message2 = _board11Controller.GetMessage(messageId2);
			Assert.IsFalse(_unitUnderTest11.CanUserRateArticle(_user11, message2));
			Assert.IsTrue(_unitUnderTest11.CanUserRateArticle(_user12, message2));
			Assert.IsFalse(_unitUnderTest11.CanUserRateArticle(_anonymous, message2));
		}
	}
}
